package edu.zhoujw.project.infra.event;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @program: mvp-center
 * @description:
 * @author: Mr.Wang
 * @create: 2021-11-19 21:25
 **/
@Data
@NoArgsConstructor
public abstract class BaseDomainEvent<T> implements Serializable {

    private static final long serialVersionUID = 1L;
    /**
     *发生时间
     */
    private LocalDateTime occurredOn;

    /**
     *领域事件数据
     */
    private T data;

    public BaseDomainEvent(T data){
        this.data=data;
        this.occurredOn =LocalDateTime.now();
    }
}
